<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Module      :  Distribution.Compat.SnocList</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Maintainer  :  cabal-dev@haskell.org</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- A very reversed list. Has efficient `snoc`</span><span>
</span><span id="line-11"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Compat.SnocList</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier">SnocList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>    </span><span class="annot"><a href="Distribution.Compat.SnocList.html#runSnocList"><span class="hs-identifier">runSnocList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="Distribution.Compat.SnocList.html#snoc"><span class="hs-identifier">snoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">newtype</span><span> </span><span id="SnocList"><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-var">SnocList</span></a></span></span><span> </span><span id="local-6989586621679623531"><span class="annot"><a href="#local-6989586621679623531"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="SnocList"><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-var">SnocList</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679623531"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span id="local-6989586621679623533"><span class="annot"><a href="Distribution.Compat.SnocList.html#snoc"><span class="hs-identifier hs-type">snoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623533"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679623533"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623533"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-23"></span><span id="snoc"><span class="annot"><span class="annottext">snoc :: forall a. SnocList a -&gt; a -&gt; SnocList a
</span><a href="Distribution.Compat.SnocList.html#snoc"><span class="hs-identifier hs-var hs-var">snoc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span id="local-6989586621679623509"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623509"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679623508"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679623508"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; SnocList a
forall a. [a] -&gt; SnocList a
</span><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-var">SnocList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679623508"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623509"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span id="local-6989586621679623529"><span class="annot"><a href="Distribution.Compat.SnocList.html#runSnocList"><span class="hs-identifier hs-type">runSnocList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623529"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679623529"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-26"></span><span id="runSnocList"><span class="annot"><span class="annottext">runSnocList :: forall a. SnocList a -&gt; [a]
</span><a href="Distribution.Compat.SnocList.html#runSnocList"><span class="hs-identifier hs-var hs-var">runSnocList</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span id="local-6989586621679623507"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623507"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623507"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span id="local-6989586621679623523"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679623501"><span id="local-6989586621679623503"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623523"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-29"></span><span>    </span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span id="local-6989586621679623497"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623497"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679623496"><span class="annot"><span class="annottext">&lt;&gt; :: SnocList a -&gt; SnocList a -&gt; SnocList a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span id="local-6989586621679623495"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623495"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; SnocList a
forall a. [a] -&gt; SnocList a
</span><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-var">SnocList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623495"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679623497"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span id="local-6989586621679623520"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679623489"><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-type">SnocList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623520"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-32"></span><span>    </span><span id="local-6989586621679623487"><span class="annot"><span class="annottext">mempty :: SnocList a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; SnocList a
forall a. [a] -&gt; SnocList a
</span><a href="Distribution.Compat.SnocList.html#SnocList"><span class="hs-identifier hs-var">SnocList</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-33"></span><span>    </span><span id="local-6989586621679623485"><span class="annot"><span class="annottext">mappend :: SnocList a -&gt; SnocList a -&gt; SnocList a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SnocList a -&gt; SnocList a -&gt; SnocList a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(&lt;&gt;)</span></a></span></span><span>
</span><span id="line-34"></span></pre></body></html>